import "bootstrap"
import "bootstrap/dist/css/bootstrap.css"
// import wbb from "./wbb.jpeg"
const wbb = require("./wbb.jpeg")
// import $ from "jquery"
import jQuery from "jquery"
// const $ = jQuery
window.$ = window.jQuery = jQuery
import myHttp from "./tools/http"

myHttp().then(res => {
  const data = res.BA10TA81wangning
  data.forEach((item, index) => {
    const {
      imgsrc,
      digest,
      title,
      source,
      ptime,
      skipURL = "javascript:void(0)"
    } = item
    $(`
      <div class="col col-xl-3 col-lg-4 col-md-6 col-sm-12">
      <div class="card" style="width: 18rem;">
          <img src="${imgsrc}" class="card-img-top" alt="...">
          <div class="card-body">
            <h5 class="card-title">${title}</h5>
            <p class="card-text">${digest}</p>
            <p class="card-text">${source}</p>
            <p class="card-text">${ptime}</p>
            <a href="${skipURL}" class="btn btn-primary">Go somewhere</a>
          </div>
        </div>
      </div>
      `).appendTo('.my-list')
  })
}).catch(e => {
  console.log(e)
}).finally(() => {
  console.log("完成")
})

